<script setup>
import { ref } from 'vue';
import Child from './Child.vue'
const cmpRef = ref(null)
const handleClick = () => {
  cmpRef.value.sayHi('吕布')
}
</script>
<template>
  <button @click="handleClick">利用 ref 父传子</button>
  <hr />
  <Child ref="cmpRef" />
</template>
